package Bity;

import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            String string = in.nextLine();
            String[] strings = string.split(" ");
            int n = Integer.parseInt(strings[0]);
            int k = Integer.parseInt(strings[1]);

            String s1 = in.nextLine();
            String[] ss1 = s1.split(" ");
            int[] s = new int[n];
            for (int i = 0; i < n; i++) {
                s[i] = Integer.parseInt(ss1[i]);
            }

            for (int i = 0; i < k; i++) {
                int max = -1;
                for (int j = 0; j < n; j++) {
                    if (s[j]%2 == 0){
                        if (max == -1 || s[max] < s[j]){
                            max = j;
                        }
                    }
                }
                //此时找到最大的偶数，除2操作
                if (max != -1){
                    s[max] /= 2;
                }else {
                    break;
                }
            }

            //求总和
            int count = 0;
            for (int i = 0; i < n; i++) {
                count+=s[i];
            }
            System.out.println(count);
        }
    }
}
